#include "StdAfx.h"
#include "ShaderProgram.h"

namespace rkt
{
	void ShaderProgram::release()
	{
		delete this;
	}

	bool ShaderProgram::bind()
	{
		std::vector<IShader *>::iterator b = m_vShaders.begin(),e = m_vShaders.end();
		while(b != e)
		{
			IShader *pShader = (*b);
			pShader->bind();
			++b;
		}

		return true;
	}

	void ShaderProgram::unbind()
	{
		std::vector<IShader *>::iterator b = m_vShaders.begin(),e = m_vShaders.end();
		while(b != e)
		{
			IShader *pShader = (*b);
			pShader->unbind();
			++b;
		}
	}

	void ShaderProgram::addShader(IShader *pShader)
	{
		m_vShaders.push_back(pShader);
	}

	bool ShaderProgram::link(bool auto_bind)
	{
		return true;
	}

	void ShaderProgram::setUniform1i(const std::string& strPara,int stage)
	{
	}
	
	void ShaderProgram::setUniform1f(const std::string& strPara,float x)
	{
	}

	void ShaderProgram::setUniform4f(const std::string& strPara,float x,float y,float z,float w)
	{
	}

	void ShaderProgram::setUniform3f(const std::string& strPara,float x,float y,float z)
	{
	}
}